1. Field of the Invention
The present invention relates to disk drives for computer systems. More particularly, the present invention relates to a disk drive maintaining a cache link attribute for each of a plurality of allocation states.
2. Description of the Prior Art
A disk drive typically comprises a cache memory for caching data written to the disk as well as data read from the disk. The overall performance of the disk drive is affected by how efficiently the cache memory can be allocated for a host command. In the past, the cache memory has been divided into cache segments each comprising a number of blocks (e.g., eight blocks), wherein the cache system would allocate a number of cache segments to process the host command. Accordingly, the cache segments can be in one of a plurality of allocation states, including at least:                free—an unallocated cache segment;        available—an allocated cache segment storing write data that has been written to the disk;        valid—an allocated cache segment storing cached read data; and        dirty—an allocated cache segment storing write data not yet written to the disk.When a host command is received, the cache system allocates cache segments for the host command according to a predetermined allocation policy. For example, the cache system may allocate cache segments having a free allocation state, then cache segments having an available allocation state, then cache segments having a valid allocation state, and finally cache segments having a dirty allocation state until enough cache segments are allocated to process the host command.        
There is, therefore, a need for a disk drive that can quickly identify cache segments in each of a plurality of allocation states in order to expedite the allocation process for a host command.